<%@ page language="java" import="java.util.*,com.king.cms.common.PowerParameter" pageEncoding="UTF-8"%>
<%@ include file="/hotel/include/css.jsp"%>
<%-- /*包含css样式表*/ --%>
<%  
	String pageFunc = "终端设置";		//功能描述
%>
<% 
	int pow=(PowerParameter.save|PowerParameter.list);
	String group = (String)request.getAttribute("group");
	Map m = (Map)request.getAttribute("data");
	String templateStr = (String)request.getAttribute("template");
	 
	if(null == m)
	  m = new HashMap();
%>


<html>
	<head>
		<title><%=pageFunc%>
		</title>
		<meta  http-equiv="Expires"     CONTENT="0">           
<meta  http-equiv="Cache-Control"     CONTENT="no-cache">           
<meta  http-equiv="Pragma"     CONTENT="no-cache">
		<script language="javascript">
	function doEnable()
	{
		form1.bmMc.disabled=false;
		form1.bmBzrs.disabled=false;
	} 
	function ki_save(){
      var flag = true;
      
 
	  if(clskg(document.getElementById("template").value) == '') {
	 	   alert('展示模板不能为空');
	 	   flag = false;
	 	   return;
	  } 
	   
	  /*if(clskg(document.getElementById("clientType").value) == '') {
	 	   alert('终端类型不能为空');
	 	   flag = false;
	 	   return;
	  } */ 
	  
	 // if(clskg(document.getElementById("defaulttemplate").value) == '') {
	 //	   alert('默认显示模版不能为空');
	 //	   flag = false;
	 //	   return;
	//  } 
	 if(flag)
	    form1.submit();
	}
	function ki_cls(){
		document.getElementById("clientName").value='';
		document.getElementById("clientIp").value='';
		//document.getElementById("clientMac").value='';
		document.getElementById("clientAddress").value='';
		//document.getElementById("clientType").value='';
		document.getElementById("template").value='';
		document.getElementById("ORDERNUM").value='';
		document.getElementById("clientArea").value='';
		//document.getElementById("defaulttemplate_<%=m.get("DEFAULT_DISPLAY_TYPE")%>").value='';
		document.getElementById("group").value='';
		document.getElementById("displayType").value='';
		
		
	}
	function ki_list(){
		window.open('<%=basePath%>client.do?action=configlist','_self');
	}
	////////除去空格/////////
	function clskg(va){
	  var th=/\s/g;
	 va=va.replace(th,'');
	 return va;
	}
	function changeSelect(lcdId){
			   var dtype = document.getElementById('displayType').value;
			    
			   if('0' == dtype){
			       var picdiv = document.getElementById('default_0');
			       var pptdiv = document.getElementById('default_1');
			      
			       if(picdiv != null)
			         picdiv.style.display='';
			         
			       if(pptdiv != null)
			         pptdiv.style.display='none';
			   }
			   if('1' == dtype){
			        var picdiv = document.getElementById('default_0');
			       var pptdiv = document.getElementById('default_1');
			       if(picdiv != null)
			         picdiv.style.display="none";
			       if(pptdiv != null)
			         pptdiv.style.display="";
			   }
			
			}
</script>
	</head>
	<body background="<%=imgpath%>top3.gif" leftmargin="0" topmargin="0">
		 <br> 
		 <center>
		<form name="form1" method="post"
			action="<%=basePath%>client.do?action=configsave">
			<table border="0" cellpadding="0" cellspacing="0" align="center" width="98%"
				height="2">
				<tr>
					<td width="9" height="1"></td>
					<td height="1" background="<%=path%>/img/images_06.gif">
						<p align="center">
							<b><%=pageFunc%></b>
					</td>
					<td width="9" height="1"></td>
				</tr>
			</table>
			<table height="48" border="0" cellpadding="2" cellspacing="1"
				class="bg_table" style="width:90%" bordercolor="#111111">
				<tr class="top_td">
					<td colspan="4"  >
						 终端默认设置
					</td>
				</tr>
				<tr class="td2" >
					<td width="20%">
						终端设备名称
					</td>
					<td width="80%"  colspan=3 >
					    <input type="hidden" value="<%=m.get("ID") %>" name="clientId">
						<%=m.get("CLIENT_NAME")==null?"":m.get("CLIENT_NAME") %>
					</td>
					
					
				</tr>
				<tr class="td2">
					<td width="20%">
						默认显示类型
					</td>
					<td width="30%" >
					    <select id="displayType" name="displayType" onchange="changeSelect('<%=m.get("ID") %>')" style="width:95%">
                        <option value="0" <%if("0".equals(m.get("DEFAULT_DISPLAY_TYPE")+"")){out.println(" selected");}%>>默认模板</option>
    	                 <option value="1" <%if("1".equals(m.get("DEFAULT_DISPLAY_TYPE")+"")){out.println(" selected");}%>>默认PPT</option>
                    </select>
					</td> 
					<td width="20%">
						默认模版
					</td>
					<td width="30%" >
						<%=m.get("DEFAULT_TEMPLATE") %>
					</td> 
					 
				</tr> 
				<tr class="td2">
					<td width="20%">
						默认是否刷新
					</td>
					<td width="30%" >
					    <select name="isrefresh" style="width:95%;">
                      <option value=0 <%if(m.get("ISREFRESH")!=null||"0".equals(m.get("ISREFRESH")+"")){out.println(" selected");} %>>否</option>
                      <option value=1 <%if(m.get("ISREFRESH")!=null&&"1".equals(m.get("ISREFRESH")+"")){out.println(" selected");} %>>是</option>
                      </select>
					</td>
					<td width="20%">
						展示模板
					</td>
					<td width="30%" >
					    <%=templateStr %>
					</td>
					 
				</tr>  
				<tr class="top_td">
					<td colspan="4"> 
					</td>
				</tr>
			</table>
</form>
</center>
		</body>
</html>
<%@ include file="/hotel/pow.jsp"%>
